<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        .big{
            width: 350px;
            height: 350px;
            margin: 50px auto 0;
            background-color: #eee;
            overflow: hidden;
        }
        .box{
            width: 200px;
            height: 200px;
            margin: 75px auto;
            background-color: #6ff;
            overflow: hidden;
        }
        .small{
            width: 100px;
            height: 100px;
            margin: 50px auto;
            background-color: #6f6;
        }
    </style>
</head>
<body>
    <div class="big">
        <div class="box">
            <div class="small"></div>
        </div>
    </div>
</body>
<script>
    var big = document.getElementsByClassName("big")[0];
    var box = document.querySelector(".box");
    var small = document.querySelector(".small");

    big.onmousedown = function(){
        console.log("big");
    }
    big.onclick = function(){
        console.log("big被点击");
    }
    box.onmousedown = function(){
        console.log("box");
    }
    box.onclick = function(){
        console.log("box被点击");
    }
    small.onmousedown = function(){
        console.log("small");
    }
    small.onclick = function(){
        console.log("small被点击");
    }

    small.onclick = function(event){
        if (event.stopPropagation) {
            event.stopPropagation()
        } else {
            event.cancelBubble = true;
        }
        console.log("small被点击");
    }
    small.onmousedown = function(event){
        if (event.stopPropagation) {
            event.stopPropagation()
        } else {
            event.cancelBubble = true;
        }
        console.log("small被点击");
    }
</script>
</html>